Gallery's list is now fed by nsfetchedresultscontroller#607
Merged
theospears merged 6 commits intobeeminder:masterfrom Jan 14, 2025
Merged
Gallery's list is now fed by nsfetchedresultscontroller#607theospears merged 6 commits intobeeminder:masterfrom
theospears merged 6 commits intobeeminder:masterfrom
Conversation
krugerk
commented
Jan 5, 2025
krugerk
commented
Jan 5, 2025
theospears
reviewed
Jan 7, 2025
aeea715 to
ffbdc01
Compare
theospears
pushed a commit
that referenced
this pull request
Jan 9, 2025
…614) ## Summary Migrated the gallery's collection view to the more modern api, using diffable datasource and snapshots. See #607 (comment). Transitions from one state to another (one set of goals to the next) is animated. ## Validation ran app in simulator, both iPhone and iPad (easier to see multiple columns and animation, for example, when filtering) rotated simulator changed sort preference filtered on gallery's goals signed out signed in navigated from gallery to goal and back assured that some goal's data changed (for example safeBuf and safeSum) and the effect was seen in the cell at the same position
ffbdc01 to
fba3fba
Compare
theospears
requested changes
Jan 13, 2025
Collaborator
theospears
left a comment
There was a problem hiding this comment.
Things are going to be so much cleaner without all the manual bookkeeping around goals/core data changing.
Added some notes. I think the most interesting one is around having NSFetchedResultsController create snapshots directly. I think we should at least try that, although it's possible it will end up being worse.
| } | ||
| } | ||
|
|
||
| try? fetchedResultsController.performFetch() |
Collaborator
There was a problem hiding this comment.
Nit: Is it worth logging if this fails?
fedacd5 to
13d5b35
Compare
13d5b35 to
4999161
Compare
theospears
reviewed
Jan 13, 2025
krugerk
commented
Jan 13, 2025
14a3b19 to
27b7b7d
Compare
theospears
approved these changes
Jan 14, 2025
This was referenced Jan 14, 2025
Merged
theospears
pushed a commit
that referenced
this pull request
Jan 15, 2025
## Summary A merge request for various cleanups that were kept out of #607 so as to make for a clean diff. ## Validation Built app Ran it in simulator
theospears
pushed a commit
that referenced
this pull request
May 6, 2025
## Summary When sorting the gallery by pledge or by recent data, the smallest pledges or least recently update goals were shown first. This is in contrast with what the website does and what the app previously did. The app currently does not provide for easily flipping the direction of these sorting tactics. ## Validation Compared the gallery's order on the website with the app. Bug was introduced in [#607](https://github.com/beeminder/BeeSwift/pull/607/files#diff-a606a3bd59aa90e96475a1104ee2119968cb34b90d9fb33afd497f204dcb03e7L357-L363) where the two previously "reversed" criteria were changed to ascending.
krugerk
added a commit
to krugerk/BeeSwift
that referenced
this pull request
Oct 29, 2025
## Summary When sorting the gallery by pledge or by recent data, the smallest pledges or least recently update goals were shown first. This is in contrast with what the website does and what the app previously did. The app currently does not provide for easily flipping the direction of these sorting tactics. ## Validation Compared the gallery's order on the website with the app. Bug was introduced in [beeminder#607](https://github.com/beeminder/BeeSwift/pull/607/files#diff-a606a3bd59aa90e96475a1104ee2119968cb34b90d9fb33afd497f204dcb03e7L357-L363) where the two previously "reversed" criteria were changed to ascending.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The initial loading (displaying) of goals on the gallery was slow. The app was still relying on passing and receiving nsnotification/notifications.
With the data in Core Data, the NSFetchedResultsController can be used.
Migrated galleryVC to use the fetched results controller.
Updated the sorting implementation accordingly, directly applying the sort type to the fetchRequest itself.
Updated the filtering as well to also apply directly to the fetchRequest.
For UI changes including screenshots of before and after is great.
UI wise this looks the same, just faster/more responsive.
Validation
Ran the app in the simulator.
Changed sorting.
Changed filters.
Signed in.
Signed out.
Navigated from Gallery to Goal and back.
Sent app into background. Brought back into foreground.
Force quit app, relaunched app.
Tickets
helps with #588